package tetris;

import java.awt.*;
import javax.swing.*;

/**
 * Runs game main window.
 * @author dejvid
 *
 */
public class StartGame extends JFrame {
	
	private static final long serialVersionUID = 1L;
	JLabel statusbar;
	StartGame game;
	
	/**
	 * Create a new game and make game window.
	 * Sets window attributes.
	 * Creates a scoreBoard.
	 */
    public StartGame() {
    	statusbar = new JLabel(" SCORE: 0");
        add(statusbar, BorderLayout.SOUTH);
        statusbar.setForeground(Color.WHITE);
        GamePanel gpanel = new GamePanel(this);
        add(gpanel);
        gpanel.start();
        setSize(300,600);
        setTitle("Tetris");  
   }

    /**
     * Adds a scoreBoard;
     * @return returns scoreBoard object.
     */
   public JLabel getStatusBar() {
       return statusbar;
   } 
   
   /**
    * Runs game window on screen.
    */
   public void run() {
	   game = new StartGame();
       game.setLocationRelativeTo(null);
       game.setBackground(Color.DARK_GRAY);
       game.setDefaultCloseOperation(EXIT_ON_CLOSE);
   }
}



